<?

# Import the application settings.
require_once(dirname(__FILE__) . '/config.php');

$fp = fopen(APPLICATION_ROOT . "/items.ini", "r", 1);

if (!$fp) {
	die("Error opening items file.");
}

$products = array();

while (!feof($fp)) {
	$buffer = fgets($fp, 4096);

	$values = split("=", $buffer, 2);
	$values[0] = trim($values[0]);
	$values[1] = trim($values[1]);

	if ($values[0] == "id") {
		$currentID = $values[1];
	}
	if ($values[0] AND $values[1] AND substr($values[0], 0, 1) != "#") {
		$products[$currentID][$values[0]] = $values[1];
	}
}

?>
